<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<{include file='backend/lib/meta.html'}>
<link rel="stylesheet" type="text/css" href="public/theme/backend/css/verydows.css" />
<link rel="stylesheet" type="text/css" href="public/theme/backend/css/main.css" />
<script type="text/javascript" src="public/script/jquery.js"></script>
<script type="text/javascript" src="public/theme/backend/js/verydows.js"></script>
<script type="text/javascript" src="public/theme/backend/js/list.js"></script>
<script type="text/javascript">
$(function(){searchRes(1)});

function searchRes(page_id){
  var dataset = {
    user_id: '<{$user.user_id}>',
    order_status:$('#order_status').val(),
    order_id:$('#order_id').val(),
    page:page_id,
    pernum: 10,
  };
  
  $.asynList("<{url m=$MOD c='order' a='index' step='search'}>", dataset, function(data){
    if(data.status == 'success'){
      $('#rows').append(juicer($('#row-tpl').html(), data));
      $('#rows tr').vdsRowHover();
      $('#rows tr:even').addClass('even');
      if(data.paging != null) $('#rows').append(juicer($('#paging-tpl').html(), data));
    }else{
      $('#rows').append("<div class='nors mt5'>未找到相关数据记录...</div>");	
    }     
  });
}

function pageturn(page_id){searchRes(page_id);}
</script>
</head>
<body>
<div class="content">
  <div class="loc"><h2><i class="icon"></i>订单记录</h2></div>
  <div class="box">
    <{include file='backend/user/bar.html'}>
    <form method="post" action="<{url m=$MOD c='user' a='view' step='order' id=$user.user_id}>">
      <div class="stools mt5">
        <select name="order_status" class="slt" id="order_status">
          <option value="" selected="selected">订单状态</option>
          <option disabled="disabled">-------------------</option>
          <{foreach $status_map as $k => $v}>
          <option value="<{$k}>"><{$v}></option>
          <{/foreach}>
        </select>
        <input class="w300 txt" name="order_id" type="text" id="order_id" placeholder="输入订单号" />
        <button type="button" class="sbtn btn" onclick="searchRes(1)">搜 索</button>
      </div>
    </form>
    <div class="module mt5" id="rows"></div>
    <{include file='backend/lib/paging.html'}>
</div>
<script type="text/template" id="row-tpl">
<form method="post" id="mulentform">
  <table class="datalist">
    <tr>
      <th width="150">订单号</th>
      <th width="100">下单日期</th>
      <th width="130">总金额 (元)</th>
      <th class="ta-l">收件人</th>
      <th width="130">订单状态</th>
    </tr>
    {@each list as v}
    <tr>
      <td><a class="blue" href="<{url m=$MOD c='order' a='view' id='${v.order_id}'}>">${v.order_id}</a></td>
      <td>$${v.created_date}</td>
      <td><b class="red">${v.order_amount}</b></td>
      <td class="ta-l">
        <p>${v.receiver}<font class="c555 ml10">(<b>${v.mobile}</b>)</font></p>
        <p class="mt5">${v.province} ${v.city} ${v.borough} ${v.address}</p>
        {@if v.zip != ''}<p class="mt5">${v.zip}</p>{@/if}
      </td>
      <td>${v.order_status}</td>
    </tr>
    {@/each}
  </table>
</form>
</script>
<script type="text/javascript" src="public/script/juicer.js"></script>
</body>
</html>